<script >
  import { onMounted, ref } from 'vue';

  export default {
  setup() {
      const ref_mix_view = ref(null);
      const ref_filter = ref(null);
      const ref_adv_query = ref();
      onMounted(() => {
  setTimeout(() => {
        ref_adv_query.value.Query();
      }, 3000);
})

      const mixViewGetScheme = () => {
        return ref_mix_view.value.GetScheme();
      };
      const mixViewSetScheme = scheme => {
        console.log('mixViewSetScheme', scheme);
       // ref_mix_view.value.SetScheme(scheme);
      };
      const filterGetScheme = () => {
        return ref_filter.value.GetFilters();
      };
      const filterSetScheme = scheme => {
         console.log('filterSetScheme', scheme);
       // ref_filter.value.SetFilters(scheme);
      };
      const query = (filterExpression, sortExpression) => {
        // alert(1111)
        // ref_mix_view.value.Query(filterExpression, sortExpression);
      };
      const mixViewRefreshByData = data => {
         ref_mix_view.value.RefreshByData(data);
      };
      const filterCheckMust = () => {
console.log('执行了筛选器检查');
        return true
       // return ref_filter.value.filterCheckMust();
      };

      return {
        filterCheckMust,
        mixViewRefreshByData,
        mixViewGetScheme,
        mixViewSetScheme,
        filterGetScheme,
        filterSetScheme,
        query,
        ref_adv_query,
        refresh(done) {
          setTimeout(() => {
            items.value.push({}, {}, {}, {}, {}, {}, {});
            done();
          }, 1000);
        },
      };
    },
  };
</script>

<template>
  <!-- 方案1 传入完整的 筛选器以及多维视图的实例子 -->

  <div>
    <p>/**</p><p>* @查询方案变更</p><p>*</p
    ><p>* updateFilterComponent（）更新筛选器 条件信息</p
    ><p>* * filterComponent.FilterFields = ****</p><p>*</p
    ><p>* updateMixedviewComponent（）更新多维视图 条件信息</p
    ><p
      >* *
      mixedviewComponent.SetScheme(currentQueryPlan,res[0]&amp;&amp;res[0].ConfigValue)</p
    ><p>*</p><p>* MixedviewComponent.Query(FilterExpression,SortExpression)</p
    ><p>*</p><p>* @筛选器变更</p><p>*</p
    ><p>* updateAdvQuery() 查询方案更新方法</p
    ><p>* * MixedviewComponent.Query(FilterExpression,SortExpression)</p><p>*</p
    ><p>* @多维视图变更</p><p>* * updateAdvQuery() 查询方案更新方法</p
    ><p
      >* * 根据条件决定是否执行
      MixedviewComponent.Query(FilterExpression,SortExpression)</p
    ><p>*</p><p>*/</p><p><br /></p>
  </div>

  <t-query-plan-p
    ref="ref_adv_query"
    pageID="****"
    pageName="****"
    pageCode="****"
    dateSource="****"
    :mixViewGetScheme="mixViewGetScheme"
    :mixViewSetScheme="mixViewSetScheme"
    :filterGetScheme="filterGetScheme"
    :filterSetScheme="filterSetScheme"
    :query="query"
    :mixViewRefreshByData="mixViewRefreshByData"
    :filterCheckMust="filterCheckMust"
    :showTips="true"
    tabIndex="1"

  ></t-query-plan-p>
</template>

<style lang="scss"></style>
